Skip to content

language: Add configuration option to disable runnables#60766

Open
AlvaroParker wants to merge 2 commits into
zed-industries:mainfrom
AlvaroParker:feat/add-runnables-option
Open

language: Add configuration option to disable runnables#60766
AlvaroParker wants to merge 2 commits into
zed-industries:mainfrom
AlvaroParker:feat/add-runnables-option

Conversation

@AlvaroParker

Copy link
Copy Markdown
Collaborator

Objective

Solution

  • Added a new runnable config to LanguageConfig that disables runnables if set to false
  • Changed config.toml config for Markdown to disable runnables

Testing

  • Added tests to check that the runnables configuration is enforced
  • Added tets to check that the default runnable configuration (true) is set, meaning, languages by default do load runnables to not change current behavior
  • This changes can be checked by opening a demo file like the one on the linked issue, and opening a language file (.go, .rs) with tests to check that runnables are still being displayed on the editor.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Showcase

image

Left is markdown with language config runnable = false and right is latest zed nightly release.


Release Notes:

  • Added runnable option to disable runnables via language configuration.
  • Fixed runnables showing up on markdown code fences

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 10, 2026
@zed-community-bot zed-community-bot Bot added community champion Issues filed by our amazing community champions! 🫶 guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions labels Jul 10, 2026
@maxdeviant maxdeviant changed the title Language: Add configuration option to disable runnables language: Add configuration option to disable runnables Jul 10, 2026
@AlvaroParker

Copy link
Copy Markdown
Collaborator Author

I wonder if having the ability to run markdown code blocks via the play gutter is indeed in the roadmap.

Having a README.md (or XYZ.md) file which typically show the steps to get certain things done via the corresponding code blocks. ie:

Install dependencies: bash npm ci

Run the service: bash npm run start

... and being able to click the play gutter on each of the blocks would be a life changer.

This doesn't address the comment at #50987 (comment)

This PR will disable runners in markdown entierly, which makes sense now since zed doesn't support runnables on Markdown files.

If runnables in markdown is in the roadmap, then a new approach for this bug is probably best. Maybe a similar configuration that avoids nested runnables (which is what's causing go runnables to appear on .md code fences).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶 guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test run gutter marker appear inside markdown code blocks but do nothing when clicked

1 participant